/**
 * 
 * @class NG.response.GetLookupXml
 * @extends Ext.util.Observable
 */
NG.response.GetLookupXml = Ext.extend(NG.response.Response, {
	
	lookupTable : null,
	
	constructor: function(config){
		NG.response.GetLookupXml.superclass.constructor.call(this, config);
	},
	
	/**
	 * Parses given xmlData (response data) <br>
	 * Fulfills lookupTable member according to parsed xml data
	 * 
	 * @param {String} xmlData - response data
	 * Called by {@link NG.response.Response.constructor}
	 */
	init: function (xmlData) {
		NG.response.GetCategories.superclass.init.call(this, xmlData);
		this.categories = [];
		var xmlStr = fleegix.xml.parse(fleegix.xml.createDoc(xmlData), 'string').string;
		var recordTag = fleegix.xml.parse(fleegix.xml.createDoc(xmlStr), "Table").Table;
		var recordArray = recordTag.Record;
		
		this.lookupTable = new NG.models.LookupTable;
		
		for (var i=0; i<recordArray.length; ++i) {
			this.lookupTable.addRecord(recordArray[i].Name, recordArray[i].Value);
		}
	},
	
	/**
	 * 
	 * @returns {Array} array of Category objects
	 */
	getLookupTable: function () {
		return this.lookupTable;
	}
});
